package com.linkq.ipinyin.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @FileName BcText
 * @Description
 * @Author wangpeng
 * @date 2024-11-12
 **/

@TableName("t_text")
@Data
public class Text extends Model<Text> implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /** 标题 */
    private String title;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date publishTime;

    /** 作者 */
    private String author;
    /** 文章内容 */
    private String content;

    /** 教材类型 */
    private String textType;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 显示方式
     * 1：居中显示  2：段落显示
     */
    private String showType;

    /** 所属年级 */
    private Integer grade;

    /**
     * 单元
     */
    private String unit;
    /** 音频 */
    private String videoId;

    /**
     * 插图
     */
    private String pictureId;

    @Transient
    @TableField(exist = false)
    private List<String> pictureName;

    @Transient
    @TableField(exist = false)
    private String videoName;

    @Transient
    @TableField(exist = false)
    private List<CnCharacter> characterList;
}
